package com.zhangwei.liwushuo.fragment;

import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.zhangwei.liwushuo.R;
import com.zhangwei.liwushuo.adapter.VpiPagerAdapter;

import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;

import java.util.ArrayList;

@EFragment(R.layout.fragment_category)
public class CategoryFragment extends BaseFragment {
    VpiPagerAdapter vpiAdapter;
    private ArrayList<Fragment> fragments = new ArrayList<>();
    @ViewById
    ViewPager categoryViewpager;

    @Override
    public void initView() {
        fragments.add(new CategoryStrategyFragment_());
        fragments.add(new CategoryGiftFragment_());
        vpiAdapter = new VpiPagerAdapter(getChildFragmentManager(), fragments);
        categoryViewpager.setAdapter(vpiAdapter);
    }
}